<% javascript 'dynamic_bagsize' %>
<h1> Coffee </h1>

<% for product in @products %>
   
	<div class = "entry">
	<table class = "store-list" width="720">
		<tr>
			<td >
				<table class = "store-list-productDesc">
					<tr>
						<td >
                          <% title = product.National.EnNationName + " / " + product.Farm.enFarmName %>                         
                          <h3> 제품명 : <%= link_to title, :action => 'show', :id => product %></h3>
				원산지 : <%=h product.National.NationName %> / <%=h product.Farm.farmName %> (농장)<br />
			</td>
					</tr>
					<tr>
						<td ><%=h product.desc1 %></td>
					</tr>
				</table>
			</td>
			<td td width="30%" >
              <% form_remote_tag :url => {:action => 'add_to_cart', :id => product, :title =>title } do %>
                  
				<table class = "store-list-productPrice" align="right">
                  
					<tr>			
						<td align="right">
                          Qty : <%= text_field_tag 'quantity', '1', :size => 2, :maxlength => 2  %>
                            </td>
					</tr>
					<tr>
						<td align="right">
                        <select id="baglist" name="baglist">
                              <option value ="<%=h product.p200 %>"> 200g: <%=h product.p200 %> 원 </option>
                              <option value ="<%=h product.p500 %>"> 500g: <%=h product.p500 %> 원 </option>

                        </select>
                        </td>
					</tr>
					<tr>
						<td align="right"> <%= collection_select "selected", "grind", @grind, :code, :name, :prompt => "Select Grind" %></td>
					</tr>                   
					<tr>
						<td align="right"> 
                         <%= submit_tag "Add to Cart" %>
                        </td>
					</tr>
				</table>                
              <% end %>
			</td>
		</tr>

	</table>
	</div>
   
<% end %>

